/*
 * ClassifiedDataSet.java
 */
package ClassifiedDataSetPackage;

import HierarchyPackage.HClass;

import java.util.Collection;
import java.util.Set;

/**
 * Data set for holding classifications of data given a hierachy.
 *
 * @author Martin Haulrich
 */
public interface ClassifiedDataSet {

    /**
     * Returns number of classes.
     * @return Number of classes.
     */
    int classCount();

    /**
     * Return all classes in.
     * @return classes.
     */
    Collection<HClass> classifications();

    /**
     * Return classes at a given depth relative to the class that has been classified from.
     * @param depth Relative depth of the classes to return.
     * @return Classes with the given depth.
     */
    Collection<HClass> classificationsAtDepth(int depth);

    /**
     * Return classes in a given depth relative to the class that has been classified from. The classes are sorted in descending order of how data points that they classify,
     * @param depth Relative depth of the classes to return.
     * @return Classes with the given depth.
     */
    Collection<HClass> classificationsAtDepthSorted(int depth);

    /**
     * Returns true if set contains the given class.
     * @param classification Class to check if whether exists in set.
     * @return True if class exists. Otwerwise false.
     */
    boolean containsClass(HClass classification);

    /**
     * Get number of data points classified by the given class.
     * @param classification Class in set.
     * @return Number of data points classified by the given class.
     */
    int getCount(HClass classification);

    /**
     * Return the depth of the class relative to the class that was used a top-class for the classification.
     * @param classification Class to get depth of.
     * @return Depth of given class.
     */
    int getDepth(HClass classification);

    /**
     * Get all data points classified by this class.
     * @param classification Class in set.
     * @return Data points classified by this class.
     */
    Set<Integer> getInstances(HClass classification);

    /**
     * Add a class and the data points it classifies to the set.
     * Note that the same class can be added only once.
     * @param classification Class to add.
     * @param depth Depth of class.
     * @param instances Instances classified by this class.
     */
    public void addClassificationWithData(HClass classification, int depth, Collection<Integer> instances);

    /**
     * Return the number of instances classified in this set.
     * @return Number of instances in set.
     */
    int size();
}
